home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / pctj8505.arc / BUG4.PAS < prev    next >
Pascal/Delphi Source File  |  1986-09-14  |  768b  |  27 lines

  1. { BUG4.PAS                                           }
  2. { This program demonstrates how MS-Pascal 3.20       }
  3. { messes up when a WORD is multiplied by a           }
  4. { constant and is then assigned to a double-word     }
  5. { integer.                                           }
  6. {                                                    }
  7.  
  8. PROGRAM bug4(output) ;
  9.  
  10.   VAR
  11.     x : integer4 ;
  12.     i : integer ;
  13.     w : word ;
  14.  
  15.   BEGIN {bug4}
  16.     w := 9 ;
  17.     i := 9 ;
  18.     writeln('BUG4 RESULTS') ;
  19.     writeln('w = ',w) ;
  20.     writeln('i = ',i) ;
  21.     writeln('Both answers should be 90000') ;
  22.     x := w * 10000 ;
  23.     writeln('w * 10000 = ',x) ;
  24.     x := i * 10000 ;
  25.     writeln('i * 10000 = ',x) ;
  26.   END. {bug4}
  27.